/**
 * author: wancheng
 * date: 2018/08/3
 * des: 考勤管理-员工考勤
 */
import request from '@/utils/request'

/**
 * 考勤，新增
 *
 * @param {} data
 */
export function addOutsideApply(data) {
  return request({
    url: '/hr/attendancemanager/addOutsideApply/mock',
    method: 'post',
    data
  })
}

export function findDetail(id) {
  return request({
    url: '/hr/attendancemanager/attendance/getDetail/mock',
    method: 'post'
  })
}

/**
 * 获取员工信息
 */
export function findUserInfoApi(params) {
  return request({
    url: '/commonquerys/queryEmplInfoByUserId',
    method: 'get',
    params: params
  })
}


/**
 * 1 查询所有
 * @param {*} status
 */
export function getAttendanceList(params) {
  return request({
    url: '/attendancedays/findAll',
    method: 'get',
    params: params
  })
}

/**
 * 2 签卡保存
 */
export function insertWrite(data) {
  return request({
    url: '/attendancesigns/insert',
    method: 'post',
    data
  })
}

/**
 * 3 查询签卡详情
 * @param {*} status
 */
export function getSignInfoApi(id) {
  return request({
    url: '/attendancesigns/find/' + id,
    method: 'get'
  })
}

/**
 * 4 查询出差,外出详情
 * @param {*} status
 */
export function getOutsideInfo(id) {
  return request({
    url: '/attendanceoutsides/businessDetail/' + id,
    method: 'get'
  })
}

/**
 * 5 查询请假详情
 * @param {*} status
 */
export function getVacationInfo(id) {
  return request({
    url: '/attendancevacations/find/' + id,
    method: 'get'
  })
}

/**
 * 6 调整-查询3天内的打卡日期
 * @param {*} status
 */
export function getAllSignApi(params) {
  return request({
    url: '/attendancedays/getTimeBefore',
    method: 'get',
    params: params
  })
}

/**
 * 7 签卡调整
 */
export function updataSignApi(params) {
  return request({
    url: '/attendancesigns/update',
    method: 'put',
    params: params
  })
}

/**
 * 8 重新计算
 */
export function recountApi(params) {
  return request({
    url: '/attendancedays/recomputation',
    method: 'get',
    params: params
  })
}



